/*
 * Created by SharpDevelop.
 * User: agsd
 * Date: 09/02/2008
 * Time: 17:08
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Windows.Forms;
using System.Text;

namespace Mogocal
{

    public interface IEventNotifier
    {
        void Notify(Google.GData.Calendar.EventEntry entry);
    }

	/// <summary>
	/// Description of EventNotifier.
	/// </summary>
	public class EventNotifier : IEventNotifier
	{
		public EventNotifier()
		{
			
		}
		
		public void Notify(Google.GData.Calendar.EventEntry entry)
		{
            StringBuilder sb = new StringBuilder("Your event ");
            sb.Append(entry.Title.Text);

            if (entry.Times.Count > 0)
            {
                sb.Append(" start at ");
                sb.Append(entry.Times[0].StartTime.ToString());
            }

            if (entry.Locations.Count > 0)
            {
				if (!(entry.Locations[0].Label == ""))
				{
				    sb.Append(" in ");
					sb.Append(entry.Locations[0].Label);
				}
            }

            sb.Append("\n Don't forget it");

			MessageBox.Show(sb.ToString(),
                "Mogocal", 
                MessageBoxButtons.OK,
                MessageBoxIcon.Information);
		}
	}
}
